ALMaSS  1.0
The Animal, Landscape and Man Simulation System
Goose_Population_Manager.h
Go to the documentation of this file.
1 /*
2 *******************************************************************************************************
3 Copyright (c) 2013, Christopher John Topping, University of Aarhus
4 All rights reserved.
5 
6 Redistribution and use in source and binary forms, with or without modification, are permitted provided
7 that the following conditions are met:
8 
9 Redistributions of source code must retain the above copyright notice, this list of conditions and the
10 following disclaimer.
11 Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
12 the following disclaimer in the documentation and/or other materials provided with the distribution.
13 
14 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
15 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
16 FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
17 BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
18 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
19 BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
20 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
21 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 ********************************************************************************************************
23 */
34 //---------------------------------------------------------------------------
35 
36 #ifndef Goose_Population_ManagerH
37 #define Goose_Population_ManagerH
38 
39 //---------------------------------------------------------------------------
40 
41 class Goose;
43 class AOR_Probe_Goose;
44 
45 //------------------------------------------------------------------------------
47 typedef std::vector<APoint> roostlist;
48 
54 {
55  public:
59  bool m_sex;
63  bool m_family;
67  int m_grpsize;
71  int m_x;
75  int m_y;
79  int m_species;
84  double m_weight;
97 };
98 
104 {
105 protected:
115  double m_area;
130  double m_grazingrate[gs_foobar];
165  double m_dist_to_closest_roost[gs_foobar];
170 public:
175  GooseActiveForageLocation(GooseSpeciesType a_type, int a_number, int a_polyref, int a_area, double a_graindensity, double a_maizedensity, double * a_grazing, Goose_Population_Manager* p_NPM);
180  void SetArea( int a_area) { m_area = a_area; }
185  double GetArea() { return m_area; }
190  int GetPolygonref() { return m_polygonref; }
196  {
197  int sum=0;
198  for (int i = (int) 0; i<gst_foobar;i++)
199  sum+=m_MaxBirdsPresent[i];
200  return sum;
201  }
206  int GetMaxSpBirdsPresent(GooseSpecies a_goose) {
207  int sum = 0;
208  switch (a_goose) {
209  case gs_Pinkfoot:
211  break;
212  case gs_Barnacle:
214  break;
215  case gs_Greylag:
217  break;
218  default:
219  return -1;
220  }
221  return sum;
222  }
223 
225  void SetPolygonref(int a_polyref) { m_polygonref = a_polyref; }
227  int GetHuntables(void);
232  int GetGooseNumbers( void ) {
233  int sum = 0;
234  for (int i = 0; i < gst_foobar; i++) {
235  sum += m_BirdsPresent[ i ];
236  }
237  return sum;
238  }
243  double GetGooseDensity( void ) {
244  //return GetGooseNumbers() / m_area;
245  return GetGooseNumbers();
246  }
251  int GetBirds(GooseSpeciesType a_type) { return m_BirdsPresent[(int)a_type]; }
256  int GetBirds( GooseSpecies a_goose ) {
257  int sum = 0;
258  switch (a_goose) {
259  case gs_Pinkfoot:
261  break;
262  case gs_Barnacle:
264  break;
265  case gs_Greylag:
267  break;
268  default:
269  return -1;
270  }
271  return sum;
272  }
273 
277  void AddGeese(GooseSpeciesType a_type, int a_number)
278  {
279  m_BirdsPresent[(int)a_type] += a_number;
280  if (m_BirdsPresent[(int)a_type] > m_MaxBirdsPresent[(int)a_type])
281  {
282  m_MaxBirdsPresent[(int)a_type] = m_BirdsPresent[(int)a_type];
283  }
284  }
289  void RemoveGeese(GooseSpeciesType a_type, int a_number) {
290  m_BirdsPresent[a_type] -= a_number;
291 #ifdef __DEBUG_GOOSE
292  if (m_BirdsPresent[a_type]<0)
293  {
294  g_msg->Warn("GooseActiveForageLocation::RemoveGeese - Negative birds at forage location", (double)m_BirdsPresent[a_type]);
295  exit(0);
296  }
297 #endif
298  }
303  double GetGrainDensity(void) { return m_graindensity; }
308  void SetGrainDensity(double a_density) { m_graindensity = a_density; }
313  double GetMaizeDensity(void) {
314  return m_maizedensity;
315  }
320  bool GetHabitatType(void) {
321  return m_HabitatType;
322  }
327  void SetMaizeDensity( double a_density ) {
328  m_maizedensity = a_density;
329  }
334  double GetGrazing(int gs) { return m_grazingrate[gs]; }
339  double GetRoostDist(int gs) { return m_dist_to_closest_roost[gs]; }
344  double GetGrazedBiomass(void) { return m_grazedbiomass; }
349  void SetGrazing(int gs, double a_density) { m_grazingrate[gs] = a_density; }
351  void SetDistToClosestRoost(int gs, double a_dist) { m_dist_to_closest_roost[gs] = a_dist; }
356  void ResetGrazing() { m_grazedbiomass = 0.0; }
357 
359  void RemoveGrainKJ(double a_kJ) { m_grainKJ_total -= a_kJ; }
360 
365  void RemoveMaizeKJ( double a_kJ ) {
366  m_maizeKJ_total -= a_kJ;
367  }
372  void Graze(double a_kJ) {
373  m_grazedbiomass += a_kJ * 0.2857;
374  }
379  void ClearBirds();
380 
382  void UpdateKJ() {
383  m_graindensity = (m_grainKJ_total / m_area) / 17.67 / 0.04;
385  }
386 };
387 
393 {
394 public:
395  // Methods
403  virtual ~Goose_Population_Manager(void);
408  int GetDayTime() { return m_daytime; }
412  int GetDaylightLeft() { return m_daylightleft; }
416  int GetIsDaylight() { return m_daylight; }
420  bool InGreylagSeason() { return m_GreylagSeason; }
424  void CreateObjects(int ob_type, TAnimal *pvo, struct_Goose* data, int number);
428  int ForageLocationInUse(int a_polyref);
432  void AddGeeseToForageLocationP(GooseSpeciesType a_type, int a_polyref, int a_number);
436  void AddGeeseToForageLocation(GooseSpeciesType a_type, int a_index, int a_number);
440  void RemoveGeeseFromForageLocation(GooseSpeciesType a_type, int a_index, int a_number);
444  int NewForageLocation(GooseSpeciesType a_type, int a_number, int a_polyref);
449  if ((m_GooseForageLocations.size() == 0) || (m_GooseForageLocations.size() <= a_index)) return NULL; else return &m_GooseForageLocations[a_index];
450  }
457  double GetFeedingRate(double a_graindensity, GooseSpecies a_species)
458  {
464  if (a_species == gs_Greylag) return m_IntakeRateVSGrainDensity_PF->GetY(a_graindensity) * 1.21;
465  else if (a_species == gs_Pinkfoot) return m_IntakeRateVSGrainDensity_PF->GetY(a_graindensity);
466  else return m_IntakeRateVSGrainDensity_PF->GetY(a_graindensity) * 0.74;
467  }
474  double GetMaizeFeedingRate(double a_maizedensity, GooseSpecies a_species) {
481  if (a_species == gs_Greylag) return m_IntakeRateVSMaizeDensity_BN->GetY(a_maizedensity) * 1.64;
482  else if (a_species == gs_Pinkfoot) return m_IntakeRateVSMaizeDensity_BN->GetY(a_maizedensity) * 1.35;
483  else return m_IntakeRateVSMaizeDensity_BN->GetY(a_maizedensity);
484  }
488  double GetForageRateDensity(double a_foragedensity) { return m_ForageRateVSGooseDensity->GetY(a_foragedensity); }
492  double GetForageGooseDensity(int a_index) { return m_GooseForageLocations[a_index].GetGooseDensity(); }
496  double GetForageGrazing(int a_index, int gs) { return m_GooseForageLocations[a_index].GetGrazing(gs); }
500  double GetGrainDensity(int a_index) { return m_GooseForageLocations[a_index].GetGrainDensity(); }
504  double GetMaizeDensity(int a_index) {
505  return m_GooseForageLocations[a_index].GetMaizeDensity();
506  }
508  void RemoveGrainKJ(double a_kJ, int a_index) { m_GooseForageLocations[a_index].RemoveGrainKJ(a_kJ); }
509 
513  void RemoveMaizeKJ(double a_kJ, int a_index) {
514  m_GooseForageLocations[a_index].RemoveMaizeKJ(a_kJ);
515  }
519  void Graze(double a_kJ, int a_index) { m_GooseForageLocations[a_index].Graze(a_kJ); }
526  void RemoveMaxForageKj(double a_forage, TTypeOfMaxIntakeSource a_maxintakesource, int m_myForageIndex);
530  int GetBirdsAtForageLoc(int a_index, GooseSpeciesType a_type) {
531  return m_GooseForageLocations[a_index].GetBirds(a_type);
532  }
536  int BirdsToShootAtPoly(int a_poly /*, double & a_protectedpct */);
540  void BirdsShot(int a_polyref, int a_numbershot, GooseHunter* a_Hunter);
544  void BangAtPoly(int a_polyref);
545 
547  Goose_Base* GetLeader(APoint a_homeloc, GooseSpecies a_species);
548 
552  void FindClosestRoost(int &a_x, int &a_y, unsigned a_type);
554  double GetDistToClosestRoost(int a_x, int a_y, unsigned a_type);
556  double GetThermalCosts(GooseSpecies a_goose) { return m_thermalcosts[a_goose]; }
558  std::vector<GooseActiveForageLocation>m_GooseForageLocations;
560  int GetNumberOfForageLocs(void) { return int(m_GooseForageLocations.size()); }
562  int GetForageLocIndex(GooseSpecies a_species, int a_x, int a_y);
566  void RecordIndForageLoc(double a_count, int a_groupsize, GooseSpecies a_species);
568  void RecordWeight(double a_weight, GooseSpecies a_species);
570  void RecordHabitatUse(int a_habitatype, GooseSpecies a_species, int a_count);
572  void RecordHabitatUseFieldObs(int a_habitatype, GooseSpecies a_species, int a_count);
574  void RecordForagingTime(int a_time, GooseSpecies a_species);
576  void RecordFlightDistance(int a_distance, GooseSpecies a_species);
578  void RecordDailyEnergyBudget(int a_deb, GooseSpecies a_species);
580  void RecordDailyEnergyBalance(int a_balance, GooseSpecies a_species);
582  void RecordState();
584  void RecordLeaveReason(TTypeOfLeaveReason a_leavereason, GooseSpeciesType a_speciestype);
585 protected:
586  // Attributes
594  double m_thermalcosts[3];
596  std::vector<int> m_youngdist;
604  std::vector<roostlist> m_roosts;
616  //GompertzCurveClass* m_ForageRateVSGooseDensity;
658  int m_HabitatUseStats[gs_foobar * tomis_foobar];
688  ofstream* m_StateStatsFile;
710  ofstream* m_GooseXYDumpFile;
711 
712  // Methods
714  virtual void Init(void);
717  virtual void DoFirst(void);
720  virtual void DoBefore() { ; }
724  virtual void DoAfter() { ; }
728  virtual void DoLast();
732  virtual void DoImmigration();
736  virtual void DoEmigration();
752  void GooseWeightStatOutput();
756  void GooseIndLocCountOutput();
760  void GooseHabitatUseOutput();
768  void ClearIndLocCountStats();
772  void ClearGooseWeightStats();
798  void ClearStateStats();
800  void StateStatOutput();
812  void ObservedOpennessQuery();
816  void WriteConfig();
820  void GetImmigrationNumbers(GooseSpecies a_goose, bool a_season);
822  bool InHuntingSeason(int a_day, GooseSpecies a_species);
824  void WriteHeaders(ofstream *a_file, std::vector<std::string> a_headers);
826  virtual void TheAOROutputProbe();
828  virtual void TheRipleysOutputProbe(FILE* /*a_prb*/){ ; };
830  virtual void CloseTheRipleysOutputProbe() { ; }
832  virtual void CloseTheReallyBigOutputProbe() { ; }
836  void XYDump();
838  std::string GooseTypeToString(GooseSpeciesType a_gst);
840  std::string GooseToString(GooseSpecies a_gs);
842  std::string IntakeSourceToString(TTypeOfMaxIntakeSource a_intake_source);
844  std::string LeaveReasonToString(TTypeOfLeaveReason a_leave_reason);
845 };
846 
847 #endif
boost::variate_generator< Mersenne_Twister, NormalDistDouble > Variate_gen
Definition: BoostRandomGenerators.h:38
GooseSpeciesType
Definition: Goose_Base.h:59
@ gst_GreylagFamilyGroup
Definition: Goose_Base.h:64
@ gst_BarnacleFamilyGroup
Definition: Goose_Base.h:62
@ gst_GreylagNonBreeder
Definition: Goose_Base.h:65
@ gst_PinkfootFamilyGroup
Definition: Goose_Base.h:60
@ gst_foobar
Definition: Goose_Base.h:66
@ gst_PinkfootNonBreeder
Definition: Goose_Base.h:61
@ gst_BarnacleNonBreeder
Definition: Goose_Base.h:63
TTypeOfMaxIntakeSource
Definition: Goose_Base.h:91
@ tomis_foobar
Definition: Goose_Base.h:96
TTypeOfLeaveReason
Definition: Goose_Base.h:103
@ tolr_foobar
Definition: Goose_Base.h:107
std::vector< APoint > roostlist
a list of goose roosts as points
Definition: Goose_Population_Manager.h:43
Definition: AOR_Probe.h:31
A simple class defining an x,y coordinate set.
Definition: ALMaSS_Setup.h:53
virtual double GetY(double a_X)
Definition: CurveClasses.cpp:73
A class to describe the goose base.
Definition: Goose_Base.h:132
The class to handle all goose population related matters.
Definition: Goose_Population_Manager.h:393
double GetDistToClosestRoost(int a_x, int a_y, unsigned a_type)
Returns the distance in to the nearest roost of a_type in meters.
Definition: Goose_Population_Manager.cpp:496
std::vector< int > m_youngdist
The observed distribution of young for pink feet.
Definition: Goose_Population_Manager.h:596
HollingsDiscCurveClass * m_IntakeRateVSGrainDensity_PF
Speed optimisation to hold all potential forage rates in the range 0-X grain density per m2.
Definition: Goose_Population_Manager.h:608
double GetThermalCosts(GooseSpecies a_goose)
Get daily thermal costs const.
Definition: Goose_Population_Manager.h:556
AOR_Probe_Goose * m_AOR_Barnacles
AOR Probe for barnacles.
Definition: Goose_Population_Manager.h:702
void ObservedOpennessQuery()
Writes a file with the openness scores on places where geese have been observed in the field.
Definition: Goose_Population_Manager.cpp:796
SimpleStatistics m_WeightStats[gs_foobar]
Statistics for the weights of the population.
Definition: Goose_Population_Manager.h:670
void XYDump()
Outputs x y data.
Definition: Goose_Population_Manager.cpp:2386
void CreateObjects(int ob_type, TAnimal *pvo, struct_Goose *data, int number)
Method for creating a new individual Goose.
Definition: Goose_Population_Manager.cpp:898
void RecordWeight(double a_weight, GooseSpecies a_species)
Record the weight.
Definition: Goose_Population_Manager.cpp:2164
void RecordFlightDistance(int a_distance, GooseSpecies a_species)
Record the flight distance.
Definition: Goose_Population_Manager.cpp:2217
double GetForageGrazing(int a_index, int gs)
Returns the forage density for a forage location and goose type. This is species specific.
Definition: Goose_Population_Manager.h:496
double m_thermalcosts[3]
Temporary storage for daily goose energetic thermal costs constant for each species.
Definition: Goose_Population_Manager.h:594
SimpleStatistics m_FlightDistanceStats[gs_foobar]
Statistics for the flight distances in the population.
Definition: Goose_Population_Manager.h:678
std::string GooseToString(GooseSpecies a_gs)
Translates gs enum to string
Definition: Goose_Population_Manager.cpp:2463
std::string IntakeSourceToString(TTypeOfMaxIntakeSource a_intake_source)
Translates tomis enum to string
Definition: Goose_Population_Manager.cpp:2478
SimpleStatistics m_LeaveReasonStats[gst_foobar][tolr_foobar]
Statistics for reasons for leaving the simulation.
Definition: Goose_Population_Manager.h:694
ofstream * m_GooseHabitatUseFieldObsFile
Pointer to an output file for goose habitat use data, field observation mimic version.
Definition: Goose_Population_Manager.h:636
void GoosePopulationDescriptionOutput()
Produces output to a standard file describing the state of the goose populations.
Definition: Goose_Population_Manager.cpp:1457
void BirdsShot(int a_polyref, int a_numbershot, GooseHunter *a_Hunter)
Passes the message to shoot a number of birds at a forage location.
Definition: Goose_Population_Manager.cpp:1862
bool m_PinkfootSeason
Flag to indicate if we are in the pinkfoot hunting season?
Definition: Goose_Population_Manager.h:600
bool InGreylagSeason()
Are we in the greylag hunting season?
Definition: Goose_Population_Manager.h:420
ofstream * m_StateStatsFile
Pointer to an output file for state stats data.
Definition: Goose_Population_Manager.h:688
virtual void DoAfter()
Things to do before the EndStep.
Definition: Goose_Population_Manager.h:724
int GetIsDaylight()
Is it daylight hours? Daylight starts at m_daytime == 0.
Definition: Goose_Population_Manager.h:416
int GetForageLocIndex(GooseSpecies a_species, int a_x, int a_y)
Get a forage location for my species (picked randomly among the active locations)
Definition: Goose_Population_Manager.cpp:2039
void RemoveGrainKJ(double a_kJ, int a_index)
Removes kJ eaten as grains from a forage area.
Definition: Goose_Population_Manager.h:508
void RecordForagingTime(int a_time, GooseSpecies a_species)
Record the time spent foraging.
Definition: Goose_Population_Manager.cpp:2203
void GooseFieldForageInfoOutput()
Produces output to a standard file describing the energetic state of all individuals of the goose pop...
Definition: Goose_Population_Manager.cpp:1302
ofstream * m_GooseEnergeticsDataFile
Pointer to an output file for goose energetics data.
Definition: Goose_Population_Manager.h:628
Variate_gen * m_variate_generator
Function to be able to draw randomly from predefined distributions.
Definition: Goose_Population_Manager.h:564
virtual void CloseTheRipleysOutputProbe()
Does nothing, but we need it here because it automatically called by the Population_Manager if the NW...
Definition: Goose_Population_Manager.h:830
void Graze(double a_kJ, int a_index)
Removes KJ as grams veg biomass from a forage area.
Definition: Goose_Population_Manager.h:519
void GetImmigrationNumbers(GooseSpecies a_goose, bool a_season)
Get the numbers to immigrate.
Definition: Goose_Population_Manager.cpp:2092
double GetForageGooseDensity(int a_index)
Returns the total goose density for a forage location.
Definition: Goose_Population_Manager.h:492
bool InPinkfootSeason()
Are we in the pinkfoot hunting season?
Definition: Goose_Population_Manager.h:418
ofstream * m_GoosePopDataFile
Pointer to an output file for goose population data.
Definition: Goose_Population_Manager.h:624
int m_migrationnumbers[3][2]
Storage for goose numbers. Used when birds are immigrating.
Definition: Goose_Population_Manager.h:598
void GooseWeightStatOutput()
Outputs simple stats for the weights in the population.
Definition: Goose_Population_Manager.cpp:1395
void WriteHeaders(ofstream *a_file, std::vector< std::string > a_headers)
Handy function for writing headers.
Definition: Goose_Population_Manager.cpp:2352
AOR_Probe_Goose * m_AOR_Pinkfeet
AOR Probe for pinkfeet.
Definition: Goose_Population_Manager.h:698
int m_HabitatUseFieldObsStats[gs_foobar *tomis_foobar]
Data for the habitat use, field observation mimic version.
Definition: Goose_Population_Manager.h:662
void GooseLeaveReasonStatOutput()
Outputs simple stats for the reasons for leaving the simulation.
Definition: Goose_Population_Manager.cpp:1436
int m_daylightleft
Number of daylight minutes left.
Definition: Goose_Population_Manager.h:592
int GetNumberOfForageLocs(void)
Get the number of forage locations.
Definition: Goose_Population_Manager.h:560
void RecordHabitatUseFieldObs(int a_habitatype, GooseSpecies a_species, int a_count)
Record the habitat use.
Definition: Goose_Population_Manager.cpp:2183
ofstream * m_GooseLeaveReasonStatsFile
Pointer to an output file for goose leave reason stats data.
Definition: Goose_Population_Manager.h:648
ofstream * m_GooseGitVersionFile
Pointer to an output file for almass version.
Definition: Goose_Population_Manager.h:654
Goose_Population_Manager(Landscape *L)
Goose_Population_Manager Constructor.
Definition: Goose_Population_Manager.cpp:550
void ClearGooseForagingTimeStats()
Clear simple stats for foraging times in the population.
Definition: Goose_Population_Manager.cpp:2208
void GooseHabitatUseFieldObsOutput()
Outputs simple stats for the goose habitat use but using rules to mimic field observations.
Definition: Goose_Population_Manager.cpp:1273
void AddGeeseToForageLocation(GooseSpeciesType a_type, int a_index, int a_number)
Adds a goose or geese to the forage location - requires an index.
Definition: Goose_Population_Manager.cpp:1806
std::string GooseTypeToString(GooseSpeciesType a_gst)
Translates gst enum to string
Definition: Goose_Population_Manager.cpp:2442
SimpleStatistics m_StateStats
Debugging code. Statistics for the number of times a state method is called.
Definition: Goose_Population_Manager.h:690
ofstream * m_GooseXYDumpFile
Pointer to an output file for goose x y data.
Definition: Goose_Population_Manager.h:710
int BirdsToShootAtPoly(int a_poly)
Returns the number of birds at a forage location - given by a poly ref.
Definition: Goose_Population_Manager.cpp:1833
bool InHuntingSeason(int a_day, GooseSpecies a_species)
Are we in the hunting season?
Definition: Goose_Population_Manager.cpp:2294
ofstream * m_GooseFieldForageDataFile
Pointer to an output file for goose field forage data.
Definition: Goose_Population_Manager.h:652
void RecordIndForageLoc(double a_count, int a_groupsize, GooseSpecies a_species)
Record a forage location count.
Definition: Goose_Population_Manager.cpp:2259
virtual void DoImmigration()
Controls immigration to the Danish simulation area.
Definition: Goose_Population_Manager.cpp:1494
double GetForageRateDensity(double a_foragedensity)
Get the forage intake rate for a forage density.
Definition: Goose_Population_Manager.h:488
void RecordHabitatUse(int a_habitatype, GooseSpecies a_species, int a_count)
Record the habitat use.
Definition: Goose_Population_Manager.cpp:2177
virtual void DoFirst(void)
Things to do before anything else at the start of a timestep.
Definition: Goose_Population_Manager.cpp:1018
GooseActiveForageLocation * GetForageLocation(unsigned int a_index)
Returns a pointer to the forage location indexed by index.
Definition: Goose_Population_Manager.h:448
void ClearGooseLeaveReasonStats()
Clear simple stats for the reasons for leaving the simulation.
Definition: Goose_Population_Manager.cpp:2284
double GetMaizeDensity(int a_index)
Returns the maize forage density for a forage location.
Definition: Goose_Population_Manager.h:504
SimpleStatistics m_IndividualForageLocationData[gs_foobar]
Statistics for the number of forage locations visited per goose of the population.
Definition: Goose_Population_Manager.h:666
bool m_GreylagSeason
Flag to indicate if we are in the greylag hunting season.
Definition: Goose_Population_Manager.h:602
virtual void TheAOROutputProbe()
The modified goose version of the standard output for creating AOR statistics.
Definition: Goose_Population_Manager.cpp:2370
ofstream * m_GooseWeightStatsFile
Pointer to an output file for goose weight stats data.
Definition: Goose_Population_Manager.h:644
std::vector< GooseActiveForageLocation > m_GooseForageLocations
Is a list of active goose forage locations where we have geese.
Definition: Goose_Population_Manager.h:558
void RecordDailyEnergyBudget(int a_deb, GooseSpecies a_species)
Record the daily energy budget.
Definition: Goose_Population_Manager.cpp:2231
std::vector< roostlist > m_roosts
The list of roosts
Definition: Goose_Population_Manager.h:604
int ForageLocationInUse(int a_polyref)
Tests if a forage location is currently in use, if so returns the index to it.
Definition: Goose_Population_Manager.cpp:1752
void GooseEnergyRecordOutput()
Produces output to a standard file describing the number of birds foraging at each field and the fiel...
Definition: Goose_Population_Manager.cpp:1371
void ClearStateStats()
Clear simple stats for the states.
Definition: Goose_Population_Manager.cpp:2276
virtual void DoBefore()
Things to do before the Step.
Definition: Goose_Population_Manager.h:720
int GetBirdsAtForageLoc(int a_index, GooseSpeciesType a_type)
Returns the number of birds at a forage location - given by a poly ref.
Definition: Goose_Population_Manager.h:530
void ClearGooseFlightDistanceStats()
Clear simple stats for flight distances in the population.
Definition: Goose_Population_Manager.cpp:2222
int GetDayTime()
Get the time of day (in minutes). For the goose model, sunrise is defined as m_daytime == 0....
Definition: Goose_Population_Manager.h:408
void ClearGooseHabitatUseStats()
Clear simple stats for habitat use.
Definition: Goose_Population_Manager.cpp:2188
void RemoveMaxForageKj(double a_forage, TTypeOfMaxIntakeSource a_maxintakesource, int m_myForageIndex)
Removes the forage eaten from the field.
Definition: Goose_Population_Manager.cpp:2073
virtual void DoLast()
Things to do after the EndStep.
Definition: Goose_Population_Manager.cpp:1085
PettiforFeedingTimeCurveClass * m_ForageRateVSGooseDensity
Speed optimisation to hold all potential competition reductions in the range 0 - 1 goose/m2.
Definition: Goose_Population_Manager.h:620
void RecordState()
Record the state.
Definition: Goose_Population_Manager.cpp:2272
void ClearIndLocCountStats()
Clear simple stats for forage location counts.
Definition: Goose_Population_Manager.cpp:2264
SimpleStatistics m_DailyEnergyBudgetStats[gs_foobar]
Statistics for the daily energy budget in the population.
Definition: Goose_Population_Manager.h:682
virtual void CloseTheReallyBigOutputProbe()
Does nothing, but we need it here because it automatically called by the Population_Manager if the NW...
Definition: Goose_Population_Manager.h:832
void AddGeeseToForageLocationP(GooseSpeciesType a_type, int a_polyref, int a_number)
Adds a goose or geese to the forage location - uses polygon number as reference.
Definition: Goose_Population_Manager.cpp:1819
void WriteConfig()
Writes a file the values of the config variables used.
Definition: Goose_Population_Manager.cpp:839
int m_HabitatUseStats[gs_foobar *tomis_foobar]
Data for the habitat use.
Definition: Goose_Population_Manager.h:658
void RemoveMaizeKJ(double a_kJ, int a_index)
Removes KJ eaten as maize from a forage area.
Definition: Goose_Population_Manager.h:513
void BangAtPoly(int a_polyref)
Passes a 'Bang' message to birds near to the location specified by the polygon reference.
Definition: Goose_Population_Manager.cpp:1947
virtual void TheRipleysOutputProbe(FILE *)
Does nothing, but we need it here because it automatically called by the Population_Manager if the NW...
Definition: Goose_Population_Manager.h:828
virtual void DoEmigration()
Controls emigration from the Danish simulation area.
Definition: Goose_Population_Manager.cpp:1651
Goose_Base * GetLeader(APoint a_homeloc, GooseSpecies a_species)
Asks for a pointer to a goose that can be followed.
Definition: Goose_Population_Manager.cpp:1989
bool m_daylight
Flag for in daylight hours. Sunrise is always at m_daytime == 0.
Definition: Goose_Population_Manager.h:590
void RemoveGeeseFromForageLocation(GooseSpeciesType a_type, int a_index, int a_number)
Removes a goose or geese to the forage location - requires an index.
Definition: Goose_Population_Manager.cpp:1812
ofstream * m_GooseHabitatUseFile
Pointer to an output file for goose habitat use data.
Definition: Goose_Population_Manager.h:632
void ClearGooseDailyEnergyBudgetStats()
Clear simple stats for daily energy budget in the population.
Definition: Goose_Population_Manager.cpp:2236
int GetDaylightLeft()
Get the daylight minutes left today.
Definition: Goose_Population_Manager.h:412
void GooseIndLocCountOutput()
Outputs simple stats for the number of forage locations visited per goose.
Definition: Goose_Population_Manager.cpp:1412
HollingsDiscCurveClass * m_IntakeRateVSMaizeDensity_BN
Speed optimisation to hold all potential forage rates in the range 0-X maize density per m2.
Definition: Goose_Population_Manager.h:612
double GetMaizeFeedingRate(double a_maizedensity, GooseSpecies a_species)
Get the forage rate when feeding on maize.
Definition: Goose_Population_Manager.h:474
int m_daytime
Holds the time of day. Note that sunrise is at m_daytime == 0.
Definition: Goose_Population_Manager.h:588
std::string LeaveReasonToString(TTypeOfLeaveReason a_leave_reason)
Translates tolr enum to string
Definition: Goose_Population_Manager.cpp:2495
int NewForageLocation(GooseSpeciesType a_type, int a_number, int a_polyref)
Creates a new forage location and adds a goose or geese to the forage location. Returns an index to t...
Definition: Goose_Population_Manager.cpp:1773
void ClearGooseDailyEnergyBalanceStats()
Clear simple stats for daily energy balance in the population.
Definition: Goose_Population_Manager.cpp:2250
ofstream * m_GooseIndLocCountFile
Pointer to an output file for goose individual forage location count data.
Definition: Goose_Population_Manager.h:640
void RecordDailyEnergyBalance(int a_balance, GooseSpecies a_species)
Record the daily energy balance.
Definition: Goose_Population_Manager.cpp:2245
void ClearGooseWeightStats()
Clear simple stats for the weights in the population.
Definition: Goose_Population_Manager.cpp:2169
void ClearGooseHabitatUseFieldObsStats()
Clear simple stats for field obs habitat use.
Definition: Goose_Population_Manager.cpp:2195
void GooseHabitatUseOutput()
Outputs simple stats for the goose habitat use.
Definition: Goose_Population_Manager.cpp:1244
double GetFeedingRate(double a_graindensity, GooseSpecies a_species)
Get the forage rate based on the grain density.
Definition: Goose_Population_Manager.h:457
AOR_Probe_Goose * m_AOR_Greylags
AOR Probe for greylags.
Definition: Goose_Population_Manager.h:706
virtual ~Goose_Population_Manager(void)
Goose_Population_Manager Destructor.
Definition: Goose_Population_Manager.cpp:514
SimpleStatistics m_DailyEnergyBalanceStats[gs_foobar]
Statistics for the daily energy balance in the population.
Definition: Goose_Population_Manager.h:686
double GetGrainDensity(int a_index)
Returns the forage density for a forage location.
Definition: Goose_Population_Manager.h:500
void RecordLeaveReason(TTypeOfLeaveReason a_leavereason, GooseSpeciesType a_speciestype)
Record the reason for leaving.
Definition: Goose_Population_Manager.cpp:2280
void FindClosestRoost(int &a_x, int &a_y, unsigned a_type)
Changes a_x & a_y to the location of the nearest roost of a_type to a_x, a_y.
Definition: Goose_Population_Manager.cpp:1000
void StateStatOutput()
Write simple stats for the states.
Definition: Goose_Population_Manager.cpp:1430
SimpleStatistics m_ForagingTimeStats[gs_foobar]
Statistics for the time spent foraging for the population.
Definition: Goose_Population_Manager.h:674
virtual void Init(void)
Called upon initialization of the simulation. Sets up output files.
Definition: Goose_Population_Manager.cpp:670
A class to hold an active goose foraging location and the number of birds of different types there.
Definition: Goose_Population_Manager.h:104
int GetMaxSpBirdsPresent(GooseSpecies a_goose)
Sum of the maximum of each goose species present (this may not be the same as the real maximum)
Definition: Goose_Population_Manager.h:206
void SetGrainDensity(double a_density)
Sets forage density (grain/m2)
Definition: Goose_Population_Manager.h:308
bool GetHabitatType(void)
Returns whether the current crop is a cereal.
Definition: Goose_Population_Manager.h:320
double m_maizeKJ_total
The total maize kJ.
Definition: Goose_Population_Manager.h:145
void SetArea(int a_area)
Set the area in m.
Definition: Goose_Population_Manager.h:180
int m_BirdsPresent[gst_foobar]
An array holding the number of geese of different type i.e. Pinkfoot families, juvs,...
Definition: Goose_Population_Manager.h:155
void RemoveGeese(GooseSpeciesType a_type, int a_number)
Removes geese to the location.
Definition: Goose_Population_Manager.h:289
void RemoveGrainKJ(double a_kJ)
Removes grain from the field as kJ.
Definition: Goose_Population_Manager.h:359
int GetBirds(GooseSpeciesType a_type)
Get how many birds of a type.
Definition: Goose_Population_Manager.h:251
void SetGrazing(int gs, double a_density)
Sets forage density (kJ/m2)
Definition: Goose_Population_Manager.h:349
double m_grainKJ_total
The total grain kJ.
Definition: Goose_Population_Manager.h:140
GooseActiveForageLocation(GooseSpeciesType a_type, int a_number, int a_polyref, int a_area, double a_graindensity, double a_maizedensity, double *a_grazing, Goose_Population_Manager *p_NPM)
Constructor for GooseActiveForageLocation.
Definition: Goose_Population_Manager.cpp:438
double m_grazedbiomass
Contains the total amount of grazing eaten today.
Definition: Goose_Population_Manager.h:135
void SetPolygonref(int a_polyref)
Set the landscape element ( LE ) reference number used by the Landscape class to identify this locati...
Definition: Goose_Population_Manager.h:225
void UpdateKJ()
Updates the grain or maize density based on the current total grain or maize amount.
Definition: Goose_Population_Manager.h:382
Goose_Population_Manager * m_OurPopulationManager
This is a time saving pointer to the correct population manager object.
Definition: Goose_Population_Manager.h:169
void ClearBirds()
Empties the bird recording arrays.
Definition: Goose_Population_Manager.cpp:468
double GetGooseDensity(void)
Returns the density of geese at the location.
Definition: Goose_Population_Manager.h:243
double m_dist_to_closest_roost[gs_foobar]
An array holding the distance to the closest roost.
Definition: Goose_Population_Manager.h:165
double GetGrainDensity(void)
Returns the current forage density (grain/m2)
Definition: Goose_Population_Manager.h:303
void SetDistToClosestRoost(int gs, double a_dist)
Sets the distance to the closest roost in meters.
Definition: Goose_Population_Manager.h:351
void Graze(double a_kJ)
Records forage removed as kJ from the field as grams.
Definition: Goose_Population_Manager.h:372
double GetRoostDist(int gs)
Returns the distance to the closest roost for gs.
Definition: Goose_Population_Manager.h:339
int GetPolygonref()
Get the landscape element ( LE ) reference number used by the Landscape class to identify this locati...
Definition: Goose_Population_Manager.h:190
int GetHuntables(void)
Returns the number of huntable birds at the location.
Definition: Goose_Population_Manager.cpp:483
int GetBirds(GooseSpecies a_goose)
Get how many birds of a species.
Definition: Goose_Population_Manager.h:256
void RemoveMaizeKJ(double a_kJ)
Removes maize from the field as kJ.
Definition: Goose_Population_Manager.h:365
void ResetGrazing()
Sets grazed biomass to zero.
Definition: Goose_Population_Manager.h:356
void AddGeese(GooseSpeciesType a_type, int a_number)
Adds geese to the location.
Definition: Goose_Population_Manager.h:277
void SetMaizeDensity(double a_density)
Sets maize forage density (kJ/m2)
Definition: Goose_Population_Manager.h:327
double GetArea()
Get the area in m.
Definition: Goose_Population_Manager.h:185
double m_graindensity
The grain density in kJ/m2.
Definition: Goose_Population_Manager.h:120
double GetGrazing(int gs)
Returns the current forage rate kJ/min assuming no other geese affect this.
Definition: Goose_Population_Manager.h:334
double GetGrazedBiomass(void)
Returns the current grazing forage eaten in g.
Definition: Goose_Population_Manager.h:344
int m_polygonref
A landscape element ( LE ) reference number used by the Landscape class to identify this location.
Definition: Goose_Population_Manager.h:110
double m_grazingrate[gs_foobar]
The grazing intake rate in kJ/min.
Definition: Goose_Population_Manager.h:130
double m_area
The area of feeding location.
Definition: Goose_Population_Manager.h:115
int m_MaxBirdsPresent[gst_foobar]
An array holding the maximum number of geese of different types and total i.e. Pinkfoot families,...
Definition: Goose_Population_Manager.h:161
int GetMaxBirdsPresent()
Sum of the maximum of all geese present (this may not be the same as the real maximum)
Definition: Goose_Population_Manager.h:195
TTypeOfMaxIntakeSource m_HabitatType
Whether it is a cereal crop, grass etc.
Definition: Goose_Population_Manager.h:150
double m_maizedensity
The maize density in kJ/m2.
Definition: Goose_Population_Manager.h:125
double GetMaizeDensity(void)
Returns the current maize forage density (kJ/m2)
Definition: Goose_Population_Manager.h:313
int GetGooseNumbers(void)
Returns the total number of geese at the location.
Definition: Goose_Population_Manager.h:232
The class for goose hunters encompsassing all their specific behaviours.
Definition: Hunters_all.h:269
A Hollings Disc curve class - type II functional response.
Definition: CurveClasses.h:136
The landscape class containing all environmental and topographical data.
Definition: landscape.h:113
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: maperrormsg.cpp:59
A curve for feeding time derived from Pettifor et al (2000). Journal of Applied Ecology 37: 103-135.
Definition: CurveClasses.h:151
Base class for all population managers.
Definition: PopulationManager.h:424
Definition: PopulationManager.h:324
The base class for all ALMaSS animal classes.
Definition: PopulationManager.h:205
Used for creation of a new Goose object.
Definition: Goose_Population_Manager.h:54
int m_species
species ID
Definition: Goose_Population_Manager.h:79
bool m_family
is part of a family
Definition: Goose_Population_Manager.h:63
Goose_Population_Manager * m_GPM
Goose_Population_Manager pointer.
Definition: Goose_Population_Manager.h:92
double m_weight
The weight.
Definition: Goose_Population_Manager.h:84
int m_x
x-coord
Definition: Goose_Population_Manager.h:71
int m_y
y-coord
Definition: Goose_Population_Manager.h:75
Landscape * m_L
Landscape pointer.
Definition: Goose_Population_Manager.h:88
APoint m_roost
Roost location.
Definition: Goose_Population_Manager.h:96
int m_grpsize
Size of family unit if any.
Definition: Goose_Population_Manager.h:67
bool m_sex
the sex
Definition: Goose_Population_Manager.h:59
class MapErrorMsg * g_msg
This pointer provides access the to the internal ALMaSS error message system.
Definition: maperrormsg.cpp:41